package com.xuxiangyang.competitionsystem.service;

import com.xuxiangyang.competitionsystem.entities.Competition;
import com.xuxiangyang.competitionsystem.entities.Group;
import com.xuxiangyang.competitionsystem.entities.Registration;
import com.xuxiangyang.competitionsystem.entities.User;
import com.xuxiangyang.competitionsystem.mapper.ArticalMapper;
import com.xuxiangyang.competitionsystem.mapper.CompMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompService implements ICompService{

    @Autowired
    private CompMapper compMapper;

    @Override
    public void insert(Competition competition) {
        compMapper.insert(competition);
    }

    @Override
    public List<Competition> getListAll(User user) {
        return compMapper.getListAll(user);
    }

    @Override
    public List<Competition> getAllComp() {
        return compMapper.getAllComp();
    }

    @Override
    public void updateComp(Competition competition) {
        compMapper.updateComp(competition);
    }

    @Override
    public void deleteById(Competition competition) {
        compMapper.deleteById(competition);
    }

    @Override
    public void submit(Registration registration) {
        compMapper.submit(registration);
    }

    @Override
    public List<Registration> getStuNoGroup(Registration registration) {
        return compMapper.getStuNoGroup(registration);
    }

    @Override
    public void updateGroupOfRegNull(Registration registration) {
        compMapper.updateGroupOfRegNull(registration);
    }

    @Override
    public void updateGroupOfReg(Group group) {
        compMapper.updateGroupOfReg(group);
    }

    @Override
    public void submitGroup(Group group) {
        compMapper.submitGroup(group);
    }

    @Override
    public void prospectus(Group group) {
        compMapper.prospectus(group);
    }

    @Override
    public List<Group> getGroup(Group group) {
        return compMapper.getGroup(group);
    }

    @Override
    public List<Registration> getStuByGroup(Group group) {
        return compMapper.getStuByGroup(group);
    }

    @Override
    public void updateGroup(Group group) {
        compMapper.updateGroup(group);
    }

    @Override
    public User getStuIdByName(Registration registration) {
        return compMapper.getStuIdByName(registration);
    }

    @Override
    public List<Group> getCompByUser(User user) {
        return compMapper.getCompByUser(user);
    }

    @Override
    public void updateGroupState(Group group) {
        compMapper.updateGroupState(group);
    }

    @Override
    public List<Group> getGroupBySchool(User user) {
        return compMapper.getGroupBySchool(user);
    }
}
